package cn.edu.nchu.fragmentdemo.bean;

import android.content.Context;

import com.j256.ormlite.dao.ForeignCollection;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.field.ForeignCollectionField;
import com.j256.ormlite.misc.BaseDaoEnabled;
import com.j256.ormlite.table.DatabaseTable;

import cn.edu.nchu.fragmentdemo.db.dao.MarkerGroupDao;

/**
 * @author Wendy
 * @time 2019/12/22
 * @Email ${EMAIL}
 */
@DatabaseTable(tableName = "marker_group")
public class MarkerGroup extends BaseDaoEnabled {

    @DatabaseField(columnName = "id", generatedId = true)
    private Integer id;
    @DatabaseField(columnName = "uk")
    private String uk;
    @DatabaseField(columnName = "set_id", canBeNull = false, foreign = true)
    private MarkerSet markerSet;
    @DatabaseField(columnName = "group_name")
    private String groupName;
    @ForeignCollectionField(eager = false)
    private ForeignCollection<Marker> marker;

    public MarkerGroup() {
    }

    public MarkerGroup(Context context) {
        setDao(MarkerGroupDao.getmarkerGroupDao(context));
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUk() {
        return uk;
    }

    public void setUk(String uk) {
        this.uk = uk;
    }

    public MarkerSet getMarkerSet() {
        return markerSet;
    }

    public void setMarkerSet(MarkerSet markerSet) {
        this.markerSet = markerSet;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public ForeignCollection<Marker> getMarker() {
        return marker;
    }

    public void setMarker(ForeignCollection<Marker> marker) {
        this.marker = marker;
    }
}
